package com.wiz.web.controllor;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.wiz.vo.to.tencent.WxReturnData;
import com.wiz.web.service.WxService;

@Controller
@RequestMapping("/wx/notify")
public class WxNotifyControllor {

	@Resource
	private WxService wxService;

	/**
	 * 微信支付回调接口
	 * @param request
	 * @return
	 */
	@RequestMapping(value="/",method=RequestMethod.POST)
    @ResponseBody
	public WxReturnData notify(HttpServletRequest request,
			HttpServletResponse response,
			HttpSession session, Model model){
		try {
			return wxService.notify(request,response);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			return null;
		}
    }
}
